import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import set_node_cls from '@dfeidao/atom-web/ui/set-node-cls';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import p001 from './p001';
import render from '@dfeidao/atom-web/render/render';
import p002 from './p002';
import set from '@dfeidao/atom-web/local/set';
export default async function a001(fd: IFeidaoAiBrowserComponent, _id: string) {
	// todo
	set(fd, '_id', _id);
	const res = await nodejs<{ plan_cla_attr_name: string }>('GuoKai/zj-000005/s001', {

		_id: _id
	});
	//	console.log(res[0].plan_cla_attr_no);
	// const plan_cla_attr_no = fd.data.node.querySelector<HTMLSelectElement>('[data-id="plan_cla_attr_name"]').value;
	const res2 = await nodejs('GuoKai/zj-000005/s003', {

	});

	const res1 = await nodejs('GuoKai/zj-000005/s002', {
		plan_cla_attr_no: res[0].plan_cla_attr_no

	});

	console.log(res);
	const render_data = Object.assign({ res }, res1, res2);
	set(fd, 'render_data', render_data);
	console.log('ss', render_data);
	render(fd, render_data, p001, 'p001', 'inner');
	render(fd, render_data, p002, 'p002', 'inner');
	const dd = fd.data.node.querySelector<HTMLDivElement>('[data-id="del"]');
	set_node_cls(dd, 'display-n', false);
}
